package lab02.test06;

/**
 * Created by Administrator on 2017/10/15.
 */
public class Circle {
    //属性：
    double radius,area,length;
    //行为：

    public Circle(double r) {
        this.radius=r;
    }
    //构造函数：
    public double Carea(){
        area=radius*radius*3.14;
        return area;
    }
    public double Clength(){
        length=2*3.14*radius;
        return length;
    }
    //main函数：
    public static void main(String[] args) {
        Circle Carea1=new Circle(3);
        System.out.println("圆的面积为"+Carea1.Carea());
        Circle Clength1=new Circle(3);
        System.out.println("圆的周长为"+Clength1.Clength());
    }
}
